<%--
 *  File:    DoctorProdLevelSummary.jsp
 *  @Author: Jamesli 
 *  Date:    2011/03/29
 *
 *  Copyright (C) 2000 - 2011 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.DoctorProdLevelSummary");  
%>

<% //--------------------------------------  variant and initialization --%>
<%
  	String strModuleName = "COM";
  	String strTableName = "v_zyldoctorprodlelvel";
    String privilegeCode = "10390";
	String contextPath = request.getContextPath();
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>


<html>
<head>
<title>DoctorProdLevelSummary</title>
<PageFlow:CheckPageFlow pageName="p_doctorprodlevel"/>
<%
	//String strTableName = "v_doctor";
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%= contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%= contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%= contextPath%>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>

<% //--------------------------------------  output variant from pageflow --%>
<%
  	Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
  	if(totalsummary == null)
  	{
    	totalsummary = new Vector();
  	}
%>
<script>
function page_leveling(){
	if(!confirm("<%= message.getMessageDesc("ARE_YOU_SURE") %>")) return;
	document.cform.actionname.value = "leveling";
	document.cform.target.value = "_self";
	isRunning = true;
	document.cform.submit();
}

function page_history(doctorprodid,leveltype)
{
	if(isEmpty(doctorprodid)||isEmpty(leveltype))
	  return;

	var status = "height=400, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no";
	var url = "DoctorProdLevelHistory.jsp?<%= OvalTools.randomURL() %>&doctorprodid=" + doctorprodid +"&leveltype=" + leveltype;
	if (typeof popwindow != 'undefined') popwindow.close();
	popwindow = window.open(url, "newwindow", status);
}

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  editform.action = "DoctorProdLevelSummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}

</script>
</head>
<body>
	
	<% //--------------------------------------  hidden form variant --%>	
	<form name="cform" method="post" action="<%= contextPath%>/Dispatcher">
	<input type="hidden" name="pagename" value="p_doctorprodlevel">
    <input type="hidden" name="actionname">

	<% //--------------------------------------  page location --%>
	<%@ include file="/inc/PageLocation.inc" %>
		
	<table width="100%" cellspacing="0" border="0" cellpadding="0">
  	<tr> 
    	<td> 
      		<table width="100%" border="0" cellspacing="0">
        	<tr> 
          		<td class="summary_top" colspan="3"></td>
        	</tr>
        	<tr>
          		<td>&nbsp;&nbsp;</td>
          		<td>
          			<table>
          				<%@ include file="/inc/SummarySearch.inc" %>
          			</table>
          		</td>	
        	</tr>
      		</table>
      
      
      		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        	
        	<% //--------------------------------------  summary header --%>
        	<tr class="deepblue-left">
        		<td width="22" class="title_center">&nbsp;</td> 
           		<td width="200" class="title_center" ><a href="javascript:page_summary('orderby','doctorcode')"><%= label.getLabelName("L_DoctorCode") %></a></td>
           		<td width="200" class="title_center" ><a href="javascript:page_summary('orderby','doctorname')"><%= label.getLabelName("L_DoctorName") %></a></td>
           		<td width="200" class="title_center" ><a href="javascript:page_summary('orderby','prodcode')"><%= label.getLabelName("L_ProdCode") %></a></td>
           		<td width="*" class="title_center" ><a href="javascript:page_summary('orderby','prodname')"><%= label.getLabelName("L_ProdName") %></a></td>
           		<td width="150" class="title_center" ><a href="javascript:page_summary('orderby','svaluename')"><%= label.getLabelName("L_Singledruglevel") %></a></td>
           		<td width="150" class="title_center" ><a href="javascript:page_summary('orderby','pvaluename')"><%= label.getLabelName("L_BPotentialitylevel") %></a></td>
           		<td width="150" class="title_center" ><a href="javascript:page_summary('orderby','tvaluename')"><%= label.getLabelName("L_DoctorTargetLevel") %></a></td>
        	</tr>
        
        	<%
             	int i = 0;
             	String strClassType = new String(); 
          	%>
          	<logic:iterate id="onerow" collection="<%= totalsummary %>">     
        
        	<%
            	HashMap oneRow = (HashMap)onerow; 
            	String strIsChecked = new String("");
            	if(i%2 == 1)
            	{
              		strClassType = "td-listrom";
            	}else{                    
              		strClassType = "";
            	}
	            
            	i++;                         
          	%>
          	<tr  onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%= strClassType %>'" class="<%= strClassType%>">     
          		<td><%=i%></td>
            	<td><custom:write property="doctorcode" name="onerow"/></td>
            	<td><custom:write property="doctorname" name="onerow"/></td>
            	<td><custom:write property="prodcode" name="onerow"/></td>
            	<td><custom:write property="prodname" name="onerow"/></td>
            	<td><custom:write property="singledruglevel" name="onerow" dictType="Level"/>&nbsp;&nbsp;<a onclick="javascript:page_history(<custom:write property="doctorprodid" name="onerow"/>,2);"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a></td>
            	<td><custom:write property="potentialitylevel" name="onerow" dictType="Level"/></td>
            	<td><custom:write property="targetlevel" name="onerow" dictType="Level"/></td>
          	</tr>
          	</logic:iterate>
        	<% //--------------------------------------  flipping page --%>
    		<%@ include file="/inc/SummaryAction.inc" %>
    		</table>
    		
    		<% //--------------------------------------  page operation button --%>
      		<table width="100%" cellspacing="0" cellpadding="0">
        	<tr> 
          		<td class="summary_top"></td>
        	</tr>
        	<tr> 
          		<td class="td_center">
            		<a onclick="page_leveling()"><custom:button type="1" label="L_ReLevelRule" imgsrc="confirm.gif" border="0" style="width:100"/></a>
          		</td>
        	</tr>
      		</table>
    	</td>
  	</tr>
  	</table>
</form>
</body>
</html>